﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.HTML
{
    #region Using Statements

    using System;

    #endregion

    /// <summary>
    /// Create a grid of frames. See the FRAMESET element definition in 
    /// HTML 4.01.
    /// </summary>
    public class HTMLFrameSetElement : HTMLElement
    {
        #region Constructors

        internal HTMLFrameSetElement(Document owner)
            : base(owner, HTMLConstants.HTML_TAG_FRAMESET)
        {
        }

        #endregion

        #region DOM Level 2 HTML Compliance

        /// <summary>
        /// The number of columns of frames in the frameset. 
        /// 
        /// See the cols attribute definition in HTML 4.01.
        /// </summary>
        public string cols
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_COLS);
            }
            set
            {
                if (String.IsNullOrEmpty(value))
                    removeAttribute(HTMLConstants.HTML_ATT_COLS);
                else
                    setAttribute(HTMLConstants.HTML_ATT_COLS, value);
            }
        }

        /// <summary>
        /// The handler that gets called when the frameset has loaded.
        /// </summary>
        public object onload
        {
            get;
            set;
        }

        /// <summary>
        /// The number of rows of frames in the frameset. 
        /// 
        /// See the rows attribute definition in HTML 4.01.
        /// </summary>
        public string rows
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_ROWS);
            }
            set
            {
                if (String.IsNullOrEmpty(value))
                    removeAttribute(HTMLConstants.HTML_ATT_ROWS);
                else
                    setAttribute(HTMLConstants.HTML_ATT_ROWS, value);
            }
        }

        #endregion
    }
}
